package com.ziroom.zifamily.zfms.web;

import com.ziroom.zifamily.zfms.logic.base.LoginLogic;
import com.ziroom.zifamily.zfms.common.util.UserUtils;
import com.ziroom.zifamily.zfms.common.util.WebAppUtils;
import com.ziroom.zifamily.zfms.pojo.obj.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 首页
 * <p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期 2018-11-28        修改人 xgh         修改内容 新增部分请求方法
 * </PRE>
 *
 * @author cuiyh9
 * @version 1.0
 * @Date Created in 2018年11月19日 18:16
 * @since 1.0
 */
@Slf4j
@Controller
public class IndexController {

    @Autowired
    private LoginLogic loginLogic;

    @RequestMapping("/")
    public String index(ModelMap  modelMap) {
        log.info("-index===========");
        UserInfo userInfo = UserUtils.getUserInfo();
        modelMap.put("name", userInfo.getNickName());
        modelMap.put("role", userInfo.getSystemCode());
        String remoteIp = WebAppUtils.getRemoteIp();
//        loginLogic.recordLoginLog(userInfo, remoteIp);
        return "/index/index";
    }

}
